package demo9;

public class demo9_3 {
    public static void main(String[] args) {
        String phoneRegex = "1[3-9]\\d{9}";
        String phone = "14123456789";
        if (phone.matches(phoneRegex)){
            System.out.println("手机号匹配成功~");
        }
        else {
            System.out.println("匹配失败！！！");
        }
        String mailRegex = "[1-9]\\d{6,10}@qq\\.com";
        String mail = "3271336325@qq.com";
        if (mail.matches(mailRegex)){
            System.out.println("邮件匹配成功~");
        }else{
            System.out.println("匹配失败!!!");
        }

    }
}
